const JSEncrypt = require('./jsencrypt.min')

/**
 * RSA encrypt password
 */
module.exports = function rsaEncryptPassword(pass, sec) {
	var encrypt = new JSEncrypt();

	var publicKey="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCcMfalZJtInaHK7I2QS/tOFu4HpOyUEvbYqf3jKNDnNQrzBl3ZYLZcvrFHWJYe4Sl3+1+1I5a8yMevbI1U751p6mIuUDj+lPSwvwndfgc6lF/Ly9QsYI4LhLQDxyMqzvzcl+8/+j643PptbAHx87TSl2K6btEKlHIjioDEev5mtQIDAQAB";
	encrypt.setPublicKey(publicKey);
	var data = encrypt.encrypt(pass);

	data=encodeURI(data).replace(/\+/g, '%2B');
	return data;
}